package cate.common.table.farm.spicefb.sheet;

import cate.common.table.ESheet;
import cate.common.table.farm.spicefb.row.SpiceFbLevelRow;
import easy.java.dev.note.NoteClass;

@NoteClass(value = "水晶峡谷章节关卡")
public class SpiceFbLevelSheet extends ESheet<SpiceFbLevelRow> {

    @Override
    public String getSheetName() {
        return "水晶峡谷关卡";
    }

    /** 命格副本一章有多少关 */
    public int getLevelNum(int chapter) {
        int num = 0;
        for (SpiceFbLevelRow row : this.list) {
            if (row.chapter == chapter) {
                num++;
            }
        }
        return num;
    }

    public int getMaxStar(int chapter) {
        return getList().stream().filter(e -> e.chapter == chapter).mapToInt(e -> e.challengeIds.size()).sum();
    }
}
